//============================================================================
// Name        : HitchServer.cpp
// Author      : Hitch
// Version     :
// Copyright   : Hitch
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include "server.hpp"

class hitch_server : public hitch::server
{
public:
	hitch_server(int port) : server(port) {}
	~hitch_server() {}

	virtual std::string handle_request(const std::string& request)
	{
		std::cout << request << std::endl;
		return "Hello";
	}
};

int main() {
	//std::cout << "!!!Hello World!!!" << std::endl; // prints !!!Hello World!!!
	hitch_server server (3535);

	try
	{
		server.run();
	}
	catch(hitch::exception e)
	{
		std::cout << "Exception caught while running the server:\n" << e.description() << "\nExiting.\n";
	}

	return 0;
}

